<project name="Commander" default="dist" basedir=".">
	<description>
    Commander Ant Build
  </description>

	<!-- set global properties for this build -->
	<property name="src" location="src" />
	<property name="build" location="bin" />
	<property name="dist" location="dist" />

	<target name="init">
		<!-- Create the time stamp -->
		<tstamp />
		<!-- Create the build directory structure used by compile -->
		<mkdir dir="${build}" />
	</target>

	<target name="build" depends="init" description="compile the source">
		<!-- Compile the java code from ${src} into ${build} -->
		<javac 
    	srcdir="${src}" 
    	destdir="${build}" 
    	encoding = "utf-8"
    	debug="true" 
    	debuglevel="lines,vars,source" 
    	deprecation="on"
		includeantruntime="on"/>
	</target>

	<target name="release" depends="init" description="compile the source">
		<!-- Compile the java code from ${src} into ${build} -->
		<javac 
	    	srcdir="${src}" 
	    	destdir="${build}" 
	    	encoding = "utf-8"
	    	classpathref="classpath" 
	    	debug="false" 
	    	deprecation="on"/>
	</target>

	<target name="dist" depends="build" description="generate the distribution">
		<!-- Create the distribution directory -->
		<mkdir dir="${dist}/lib" />

		<!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file -->
		<!-- <jar jarfile="${dist}/lib/Commander-${DSTAMP}.jar" basedir="${build}" /> -->
		<jar jarfile="${dist}/lib/Commander.jar" basedir="${build}" />
	</target>

	<target name="javadoc" depends="init" description="Create Javadocs for this project.">
		<mkdir dir="${build}/javadoc"/>
		<javadoc packagenames="cz.enif.commander.*"
  	           sourcepath="src"
  	           excludepackagenames="cz.enif.commander.test.*"
  	           defaultexcludes="yes"
  	           destdir="${build}/javadoc"
  	           author="true"
  	           version="true"
  	           use="true"
			   encoding = "utf-8"
  	           windowtitle="Commander API">
			<doctitle>
				<![CDATA[<h1>Commander</h1>]]></doctitle>
		<bottom>
			<![CDATA[<i>Copyright &#169; 2011 Přemysl Fára. All Rights Reserved.</i>]]></bottom>
	<group title="Commander Interfaces" packages="cz.enif.commander.I*"/>
</javadoc>
</target>

<target name="clean" description="clean up">
<!-- Delete the ${build} and ${dist} directory trees -->
<delete dir="${build}" />
<delete dir="${dist}" />
</target>
</project>
